#include <stdio.h>
#include <sys/auxv.h>

int get_info(void)
{
	int i = 0;

	unsigned long sysinfo_ehdr = getauxval(AT_SYSINFO_EHDR);
	if (!sysinfo_ehdr) {
		printf("AT_SYSINFO_EHDR is not present!\n");
		return -1;
	}
	printf("at_sysinfo_ehdr = 0x%lx\n", sysinfo_ehdr);

	sysinfo_ehdr = getauxval(AT_SYSINFO);
	if (!sysinfo_ehdr) {
		printf("AT_SYSINFO is not present!\n");
	}
	printf("at_sysinfo = 0x%lx\n", sysinfo_ehdr);

	for (i = 0; i < 51; i++) {
		sysinfo_ehdr = getauxval(i);
		if (!sysinfo_ehdr) {
			printf("AT_SYSINFO is not present!\n");
		}
		printf("at_sysinfo = %d = 0x%lx\n", i, sysinfo_ehdr);
	}

	return 0;
}

int main()
{
	get_info();
	return 0;
}
